package com.example.goodrubish.Garbage;

import android.content.Context;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;

import java.util.List;

// QuestionAdapter.java
public class QuestionAdapter extends FragmentStatePagerAdapter {
    private List<Question> questionList;
    private Context context;

    public QuestionAdapter(FragmentManager fm, List<Question> questionList) {
        super(fm);
        this.questionList = questionList;
        this.context = context;
    }

    @Override
    public Fragment getItem(int position) {
        Question question = questionList.get(position);
        return QuestionFragment.newInstance(question);
    }

    @Override
    public int getCount() {
        return questionList.size();
    }
}
